<template>
  <div class="school">
    <h3>学校名称：{{ name }}</h3>
    <h3>地址：{{ address }}</h3>
    <button @click="sendSchoolName">学校发送</button>
  </div>
</template>

<script>
export default {
  name: "School",
  data() {
    return {
      name: "大学FG",
      address: "福州",
    };
  },
  props:['getSchoolName'],
  methods:{
    sendSchoolName(){
      this.getSchoolName(this.name);
    }
  }
};
</script>

<style scoped>
.school {
  background-color: red;
  padding: 5px;
}
</style>